home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / awe / awe-full.lha / Awe2 / DoNotUseThisSrc / CpuMultiplexor.cc < prev    next >
C/C++ Source or Header  |  1990-08-08  |  2KB  |  126 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. // 
  3. // Copyright (C) 1988 University of Illinois, Urbana, Illinois
  4. //
  5. // written by Dirk Grunwald (grunwald@cs.uiuc.edu)
  6. //
  7.  
  8. #ifdef __GNUG__
  9. #  pragma implementation
  10. #endif
  11.  
  12. #include "CpuMultiplexor.h"
  13. #include "Thread.h"
  14. #include "ThreadContainer.h"
  15. #include "ReserveByException.h"
  16. #include <math.h>
  17.  
  18. static const int NOTREACHED = 0;
  19.  
  20. int CpuMultiplexors;
  21. CpuMultiplexor *ThisCpu;
  22. SpinLock CpuCerrLock;
  23.  
  24. //
  25. //    This can not be private, or we wont see all the action
  26. //
  27.  
  28. volatile int StopCpuMux;
  29. int CpuMuxDebugFlag = 0;
  30.  
  31. CpuMultiplexor::CpuMultiplexor(int debug) : systemContext(0, 0)
  32. {
  33.     pNameTemplate = "CpuMux";
  34.     currentThread = 0;
  35.     enabled = 0;
  36.     iYam = 0;
  37.     pid = 0;
  38.     CpuMuxDebugFlag = debug;
  39.     ThisCpu = this;
  40.     terminated = &StopCpuMux;
  41.     sprintf(nameSpace, "[%s-%d] ", pNameTemplate, iYam);
  42.     pName = nameSpace;
  43. }
  44.  
  45. CpuMultiplexor::~CpuMultiplexor()
  46. {
  47.     // empty
  48. }
  49.  
  50. void
  51. CpuMultiplexor::debug(int newdebug)
  52. {
  53.     CpuMuxDebugFlag = newdebug;
  54. }
  55.  
  56. int
  57. CpuMultiplexor::debug()
  58. {
  59.     return(CpuMuxDebugFlag);
  60. }
  61.  
  62. void
  63. CpuMultiplexor::terminateAll()
  64. {
  65.     StopCpuMux = 1;
  66. }
  67.  
  68. //void
  69. //CpuMultiplexor::allocateLocalEventStructures(int newIYam, int outOf)
  70. //{
  71. //    // empty
  72. //}
  73.  
  74. void
  75. CpuMultiplexor::allocateEventStructures(int newIYam, int outOf)
  76. {
  77.     // empty
  78. }
  79.  
  80. void
  81. CpuMultiplexor::deallocateEventStructures()
  82. {
  83.     // empty
  84. }
  85.  
  86. void
  87. CpuMultiplexor::fireItUp(int, unsigned)
  88. {
  89.     assert( NOTREACHED );
  90. }
  91.  
  92. void
  93. CpuMultiplexor::warmThePot(int)
  94. {
  95.     assert( NOTREACHED );
  96. }
  97.  
  98. void
  99. CpuMultiplexor::coolItDown()
  100. {
  101.     assert( NOTREACHED );
  102. }
  103.  
  104. void
  105. CpuMultiplexor::add(Thread*)
  106. {
  107.     assert( NOTREACHED );
  108. }
  109.  
  110. Thread *
  111. CpuMultiplexor::remove()
  112. {
  113.     assert( NOTREACHED );
  114.     return(0);
  115. }
  116.  
  117. //
  118. // This is the job dispatcher.
  119. //
  120.  
  121. void
  122. CpuMultiplexor::stirItAround()
  123. {
  124.     assert( NOTREACHED );
  125. }
  126.